Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Funkcja T(n,m) - to nie dziala, bledne polecenie*/
- #include <stdio.h>
- unsigned long int T(int n, int m) {
- if (m > 1 || n > 1)
- return T(n-1, m) + 2*T(n, m-1) + 1;
- return 1;
- }
- int main(void) {
- printf("T(7,7) = %lu\n", T(7,7));
- return 0;
- }
- /* Napisy.c */
- #include <stdio.h>
- int ile_malych_a(const char* str) {
- int count = 0;
- while (*str)
- if ( *str++ == 'a' ) count++;
- return count;
- }
- /* test! */
- int main(void) {
- char napis[] = "Mam w sobie tylko dwie litery 'a'.";
- char napis2[] = "A tutaj mamy wiecej liter 'a', zeby sprawdzic,"
- "czy to dziala.";
- printf("napis (2): %d\n", ile_malych_a(napis));
- printf("napis2 (6): %d\n", ile_malych_a(napis2));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment